package com.iot08.api.controller;

import com.iot08.api.controller.base.BaseController;
import com.iot08.api.service.WallpaperCategoryService;
import com.iot08.api.vo.request.WallpaperCategoryAddEditReqVo;
import com.iot08.api.vo.request.base.BaseAccountReqVO;
import com.iot08.common.utils.response.ResponseMap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author cwj
 * @description
 * @date 2025/3/10 10:28
 **/
@Slf4j
@RestController
@RequestMapping("getway/wpCategory")
public class WallpaperCategoryController extends BaseController {

    @Resource
    private WallpaperCategoryService wallpaperCategoryService;

    /**
     * @description 查询分类信息
     * @author cwj
     * @param [vo]
     * @return com.iot08.common.utils.response.ResponseMap
     * @date @time 2025/3/10 18:13
     **/
    @GetMapping("/query")
    public ResponseMap queryWallpaperCategory(@Validated BaseAccountReqVO vo){
        return wallpaperCategoryService.queryWallpaperCategory();
    }

    /**
     * @description 添加分类
     * @author cwj
     * @param [vo]
     * @return com.iot08.common.utils.response.ResponseMap
     * @date @time 2025/3/12 10:17
     **/
    @PostMapping("/add")
    public ResponseMap addWallpaperCategory(@Validated WallpaperCategoryAddEditReqVo vo){
        return wallpaperCategoryService.addWallpaperCategory(vo);
    }


    /**
     * @description 修改分类信息
     * @author cwj
     * @param [vo]
     * @return com.iot08.common.utils.response.ResponseMap
     * @date @time 2025/3/12 10:17
     **/
    @PostMapping("/edit")
    public ResponseMap editWallpaperCategory(@Validated WallpaperCategoryAddEditReqVo vo){
        return wallpaperCategoryService.editWallpaperCategory(vo);
    }
}
